package com.pl.myshop.business.profile.feign.fallback;

import com.pl.myshop.business.profile.feign.ProfileFeign;
import com.pl.myshop.common.utils.MapperUtils;
import com.pl.myshop.commons.dto.ResponseResult;
import com.pl.myshop.commons.dto.errorcode.ErrorCodeEnmu;
import com.pl.myshop.provider.domain.UmsAdmin;
import org.springframework.stereotype.Component;

/**
 * <p>
 *
 * @Description: TODO
 * </p>
 * @ClassName ProfileFeignFallback
 * @Author pl
 * @Date 2020/3/28
 * @Version V1.0.0
 */
@Component
public class ProfileFeignFallback implements ProfileFeign {
    @Override
    public String getUserProfile(String userName) {
        try {
            return MapperUtils.obj2json(new ResponseResult<UmsAdmin>(ErrorCodeEnmu.FEIGN_SEARCH_ERROR.getErrorCode(),ErrorCodeEnmu.FEIGN_SEARCH_ERROR.getMessage()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ErrorCodeEnmu.FEIGN_SEARCH_ERROR.getMessage();
    }
}